-
Notifications
You must be signed in to change notification settings - Fork 59
fix kafka producer members filter to properly display completions for kafka producer #1037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe change modifies the completion filter logic in ChipExpressionEditor to include enum-member kinds when a prefix is provided. Previously, enum-members were excluded from completions; now they are treated alongside functions, variables, and fields during prefix matching. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/utils.ts (1)
145-150: Re-evaluate whether enum members should also appear when no prefix is presentWhen
prefixis falsy, the filter still returns onlykind === 'field'. For the value serializer dropdown, that means enum members won’t show up until the user starts typing. If the UX expectation is to see all serializer options immediately on opening the dropdown (even before typing), consider includingenum-memberin the no-prefix branch as well.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/utils.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-24T22:16:28.380Z
Learnt from: dan-niles
Repo: wso2/vscode-extensions PR: 980
File: workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/RichTextTemplateEditor/RichTextTemplateEditor.tsx:384-412
Timestamp: 2025-11-24T22:16:28.380Z
Learning: In the RichTextTemplateEditor component (workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/RichTextTemplateEditor/RichTextTemplateEditor.tsx), token fetching on external `value` prop changes is intentionally disabled. Users cannot edit both the minimized and expanded editors simultaneously, so tokens only need to be generated based on user typing in the expanded editor view, not on external prop updates.
Applied to files:
workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/utils.ts
🔇 Additional comments (1)
workspaces/ballerina/ballerina-side-panel/src/components/editors/MultiModeExpressionEditor/ChipExpressionEditor/utils.ts (1)
152-155: Enum-member inclusion in prefix-based filtering looks correctAllowing
completion.kind === 'enum-member'in the prefix filter aligns with the goal of surfacing enum-based serializers (e.g.,SER_AVRO) when the user types a prefix likeSER_. The case-insensitivestartsWithcheck is consistent with the existing pattern and should cover the reported kafka:Producer scenario.Please double-check that the completion items for Kafka serializer values actually come through with
kind === 'enum-member'(and not e.g.enumMemberor another variant) in the@wso2/ui-toolkitCompletionItemtype, just to avoid a silent mismatch.
Purpose
The value serializer dropdown in
kafka:Producerwas missing several serializer options.This prevented users from selecting certain serializer types (e.g.,
SER_AVRO) when typing prefixes such asSER_.This PR resolves wso2/product-ballerina-integrator#1983
Goals
Approach
The issue was caused by the completion filtering logic excluding valid completion types.
To fix this, the filter was updated to allow completions where:
completion.kind === 'enum-member'This ensures that serializer-related suggestions are included in the completions.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.